import type { FieldRule } from "vant"

// 密码登录校验
const mobileRules: FieldRule[] = [
    { required: true, message: '请输入手机号' },
    { pattern: /^1[3-9]\d{9}$/, message: '手机格式不正确'}
]

const passwordRules: FieldRule[] = [
    { required: true, message: '请输入密码' },
    { pattern: /^\w{8,24}$/, message: '密码需8-24个字符' }
]

// 短信验证校验
const codeRules: FieldRule[] = [
    { required: true, message: '请输入验证码' },
    { pattern: /^\d{6}$/, message: '请输入六个数字的验证码'}
]

// 导出规则 可复用
export { mobileRules, passwordRules, codeRules }